home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 15 / CU Amiga Magazine's Super CD-ROM 15 (1997)(EMAP Images)(GB)[!][issue 1997-10].iso / CUCD / Graphics / Ghostscript / source / sjpegerr.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-06-23  |  2.8 KB  |  81 lines

  1. /* Copyright (C) 1994, 1995 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of Aladdin Ghostscript.
  4.   
  5.   Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author
  6.   or distributor accepts any responsibility for the consequences of using it,
  7.   or for whether it serves any particular purpose or works at all, unless he
  8.   or she says so in writing.  Refer to the Aladdin Ghostscript Free Public
  9.   License (the "License") for full details.
  10.   
  11.   Every copy of Aladdin Ghostscript must include a copy of the License,
  12.   normally in a plain ASCII text file named PUBLIC.  The License grants you
  13.   the right to copy, modify and redistribute Aladdin Ghostscript, but only
  14.   under certain conditions described in the License.  Among other things, the
  15.   License requires that the copyright notice and this notice be preserved on
  16.   all copies.
  17. */
  18.  
  19. /* sjpegerr.c */
  20. /* IJG error message table for Ghostscript. */
  21. #include "stdio_.h"
  22. #include "jpeglib.h"
  23. #include "jversion.h"
  24.  
  25. /*
  26.  * This file exists solely to hold the rather large IJG error message string
  27.  * table (now about 4K, and likely to grow in future releases).  The table
  28.  * is large enough that we don't want it to be in the default data segment
  29.  * in a 16-bit executable.
  30.  *
  31.  * In IJG version 5 and earlier, under Borland C, this is accomplished simply
  32.  * by compiling this one file in "huge" memory model rather than "large".
  33.  * The string constants will then go into a private far data segment.
  34.  * In less brain-damaged architectures, this file is simply compiled normally,
  35.  * and we pay only the price of one extra function call.
  36.  *
  37.  * In IJG version 5a and later, under Borland C, this is accomplished by making
  38.  * each string be a separate variable that's explicitly declared "far".
  39.  * (What a crock...)
  40.  *
  41.  * This must be a separate file to avoid duplicate-symbol errors, since we
  42.  * use the IJG message code names as variables rather than as enum constants.
  43.  */
  44.  
  45. #if JPEG_LIB_VERSION <= 50        /**************** ****************/
  46.  
  47. #include "jerror.h"        /* get error codes */
  48. #define JMAKE_MSG_TABLE
  49. #include "jerror.h"        /* create message string table */
  50.  
  51. #define jpeg_std_message_table jpeg_message_table
  52.  
  53. #else /* JPEG_LIB_VERSION >= 51 */    /**************** ****************/
  54.  
  55. /* Create a static const char[] variable for each message string. */
  56.  
  57. #define JMESSAGE(code,string)    static const char far_data code[] = string;
  58.  
  59. #include "jerror.h"
  60.  
  61. /* Now build an array of pointers to same. */
  62.  
  63. #define JMESSAGE(code,string)    code ,
  64.  
  65. static const char far_data * const far_data jpeg_std_message_table[] = {
  66. #include "jerror.h"
  67.   NULL
  68. };
  69.  
  70. #endif /* JPEG_LIB_VERSION */        /**************** ****************/
  71.  
  72. /*
  73.  * Return a pointer to the message table.
  74.  * It is unsafe to do much more than this within the "huge" environment.
  75.  */
  76.  
  77. const char * const *
  78. gs_jpeg_message_table (void)
  79. {    return jpeg_std_message_table;
  80. }
  81.